using System.Windows.Forms;
using pub.CmdUI.Cmd;
using pub.CmdUI.UI.Control;

namespace todo.Cmd.File
{
    public class SaveCmd : DefaultCmd, ICmdState
    {
        public SaveCmd()
        {
            Shortcut = new CmdShortcut(Keys.Control | Keys.S);
        }

        bool ICmdState.Enabled
        {
            get { return App.Dirty; }
        }

        public override void Execute(IControlUI controlUi)
        {
            App.MainForm.Save();
        }
    }
}